package days25.title392;

/**
 * @Author fengzihao
 * @Date 2024-05-09 20:53
 */
class Solution {
    public boolean isSubsequence(String s, String t) {
        if (s.isEmpty())
            return true;
        if (s.length()>t.length())
            return false;
        if (s.length()==t.length()&&s.equals(t))
            return true;
        int tag = 0;
        for (int i = 0; i < t.length(); i++) {
            if (tag==s.length())
                return true;
            if (s.charAt(tag)==t.charAt(i))
                tag++;
        }
        return tag == s.length();
    }
}